﻿using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;
using SkypeQuoteEditor.Properties;

namespace SkypeQuoteEditor
{
    public partial class AboutBox : Form
    {
        public AboutBox()
        {
            InitializeComponent();
            Icon = Resources.skype_metal;
            var assembly = Assembly.GetExecutingAssembly();
            var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
            lblVer.Text = string.Format("Version: {0}", fvi.FileVersion);
            richTbxHelp.Text = Resources.HowToUseHint;
        }

        private void close_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                Process.Start(Resources.LastVersionLink);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Resources.AboutBox_link_LinkClicked_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void link_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                Process.Start("http://habrahabr.ru/post/138051/");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Resources.AboutBox_link_LinkClicked_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
